package com.kamistoat.meimeimall.meimeimallproduct.web;

import com.kamistoat.meimeimall.common.annotation.DubboAndHTTPExceptionCatch;
import com.kamistoat.meimeimall.common.constant.DatabaseConstant;
import com.kamistoat.meimeimall.common.utils.R;
import com.kamistoat.meimeimall.meimeimallproduct.dao.*;
import com.kamistoat.meimeimall.meimeimallproduct.entity.*;
import com.kamistoat.meimeimall.meimeimallproduct.service.SkuInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Api(tags = "Sku管理页面")
@RestController
@RequestMapping("web")
public class SkuManagePageController {
    protected Logger logger = LoggerFactory.getLogger(SkuManagePageController.class);

    @Autowired
    SkuInfoService skuInfoService;

    /**
     * 测试
     * @param skuPerSpu 设3. 30000SKU
     * @return
     */
    @ApiOperation("构建测试Sku数据")
    @GetMapping("/construct_test_spu_data")
    // @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R consturctTestSkuData(@RequestParam("skuPerSpu") Integer skuPerSpu) {
        skuInfoService.constructTestSkuData(skuPerSpu);
        return R.ok();
    }

}
